package org.telegram.bot.service.impl;

import org.springframework.stereotype.Service;
import org.telegram.bot.handle.IBotSendMessage;
import org.telegram.bot.service.ILeftGroupService;
import org.telegram.telegrambots.meta.api.methods.updatingmessages.DeleteMessage;
import org.telegram.telegrambots.meta.api.objects.Update;

/**
 * @Author: wyx
 * @Date: 2023/5/28 16:49
 */
@Service
public class LeftGroupServiceImpl implements ILeftGroupService, IBotSendMessage {

    @Override
    public void handle(Update update, Long chatId, String botName) {
        send(botName,DeleteMessage.builder().chatId(chatId).messageId(update.getMessage().getMessageId()).build());
    }
}
